<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>D3 选择集概念练习</title>
    <script src="https://cdn.bootcss.com/d3/5.15.1/d3.js"></script>
    <style>
        div {
            height: 100px;
            width: 100px;
            background-color: #ccc;
            margin: 10px;
        }

    </style>
</head>

<body>

    <p></p>
    <p></p>
    <p></p>

    <script>
        var dataset = [3, 6, 9, 12, 15];
       
        d3.select("body")
            .selectAll("p")
            .data(dataset)
            .text("hhh")
            .enter()
            .append("p")
            .text("文字")
    </script>
</body>

</html>
